﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Practices.Unity;

namespace ERPStore.Start
{
	public class ServicesConfig
	{
		public static void Configure(IUnityContainer container)
		{
			// Enregistrement des services
			container.RegisterType<Services.ICacheService, Services.SimpleCacheService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IScheduledTaskService, Services.VoidScheduledTaskService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IIncentiveService, Services.VoidIncentiveService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IEmailerService, Services.EmailerService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IFraudService, Services.VoidFraudService>();
			container.RegisterType<Services.IRealtimeMessageService, Services.VoidRealtimeMessageService>();
			container.RegisterType<Services.ISalesService, Services.SalesService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IOffersService, Services.VoidOfferService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IAccountService, Services.VoidAccountService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.ILeadSourceRegistrationService, Services.VoidLeadSourceRegistrationService>();
			container.RegisterType<Services.ICRMService, Services.VoidCRMService>();
			container.RegisterType<Services.ICommentService, Services.VoidCommentService>();
			container.RegisterType<Logging.ILogger, Logging.DiagnosticsLogger>();
			container.RegisterType<Services.ILocalizationService, Services.VoidLocalizationService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IValidatorService, Services.FluentValidatorService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IProductStatService, Services.VoidProductStatService>(new ContainerControlledLifetimeManager());
			container.RegisterType<Services.IVisitorService, Services.VoidVisitorService>(new Microsoft.Practices.Unity.PerThreadLifetimeManager());
		}
	}
}
